package cn.nnxy.zentao.service.impl;

import cn.nnxy.zentao.domain.ZCases;
import cn.nnxy.zentao.mapper.ZCasesMapper;
import cn.nnxy.zentao.service.CasesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CasesServiceImpl implements CasesService {

    @Autowired
    private ZCasesMapper casesMapper;


    @Override
    public List<ZCases> queryList() {
        return casesMapper.selectList();
    }

    @Override
    public int updateById(ZCases cases) {
        if (null == cases || cases.getCasId() == null) {
            return 0;
        }
        return casesMapper.updateById(cases);
    }

    @Override
    public ZCases seletById(Integer id) {
        if (null == id){
            return null;
        }
        return casesMapper.selectById(id);
    }

    @Override
    public int saveCases(ZCases cases) {
        if (null == cases) {
            return 0;
        }
        return casesMapper.insert(cases);
    }
}
